import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';

class HitTestBlocker extends SingleChildRenderObjectWidget {
  @override
  RenderObject createRenderObject(BuildContext context) {
     return _HitTestBlockerRender();
  }
}


class _HitTestBlockerRender extends RenderProxyBox{

  @override
  bool hitTest(BoxHitTestResult result, {required Offset position}) {
    ///不调用super,命中事件不往下发
    return true;
  }

  @override
  bool hitTestSelf(Offset position) {
    return true;
  }
}

